<script language="javascript">
<!--
function upload(){
//当前值传递给父窗口的相关表单
opener.document.myform.lanmu.value=document.s1.erj.value; 
window.close();
//window.opener.location.reload();
}
-->
</script>

<?php
if($_GET[name])
$name=$_GET[name];
if($_GET[n])
$name=$_GET[n];
if($name==9){
?>
<script language="javascript" type="text/javascript">
function goto(n){
this.location.href="erlan.php?name=9&id="+n;
}
</script>
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<form action="admin_xxtd.php" method="post" name="s1">
<table boder="0" width="170" cellpadding="0" cellspacing="0" class="tdbg" height="20"><tr><td align="center">
<select name="yj" onchange="goto(this.value)" size="1">
<option>一级栏目</option>
<?php
require_once("../include/conn.php");
$sql="select * from bl_bume where  parentid =9 ";
$result=mysql_query($sql);
while($row=mysql_fetch_assoc($result)){
?>
<option value="<? echo $row["id"];?>"<?php if($_GET["id"]==$row["id"]){echo 'selected="selected"';}?>><? echo $row["buname"];?></option>
<?php
}
?>
</select>
<select name="erj" onchange="parent.document.getElementById('erj').value=this.value" size="1">
<option>二级栏目</option>
<?php
if(!empty($_GET["id"])){
	//echo “ok";
	$sql1="select * from bl_bume where parentid=".$_GET["id"]." order by id asc";
	$result1=mysql_query($sql1);
	while($row1=mysql_fetch_assoc($result1)){
		?>
		<option value="<?php echo $row1["id"];?>" ><? echo $row1["buname"];?></option>
		<?php
		}
	}
?>
</select>
<input type="submit" value="确定" name="submit"  onclick="upload()"/>
</td>
</tr></table>
</form>
<?php 
}else{
?>
<script language="javascript" type="text/javascript">
function goto(n){
this.location.href="erlan.php?id="+n;
}
</script>
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
<form action="admin_xxtd.php" method="post" name="s1">
<table boder="0" width="170" cellpadding="0" cellspacing="0" class="tdbg" height="20"><tr><td align="center">
<select name="yj" onchange="goto(this.value)" size="1">
<option>一级栏目</option>
<?php
require_once("../include/conn.php");
$sql="select * from bl_bume where parentid =10  ";
$result=mysql_query($sql);
while($row=mysql_fetch_assoc($result)){
?>
<option value="<? echo $row["id"];?>"<?php if($_GET["id"]==$row["id"]){echo 'selected="selected"';}?>><? echo $row["buname"];?></option>
<?php
}
?>
</select>
<select name="erj" onchange="parent.document.getElementById('erj').value=this.value" size="1">
<option>二级栏目</option>
<?php
if(!empty($_GET["id"])){
	//echo “ok";
	$sql1="select * from bl_bume where parentid=".$_GET["id"]." order by id asc";
	$result1=mysql_query($sql1);
	while($row1=mysql_fetch_assoc($result1)){
		?>
		<option value="<?php echo $row1["id"];?>" ><? echo $row1["buname"];?></option>
		<?php
		}
	}
?>
</select>
<input type="submit" value="确定" name="submit"  onclick="upload()"/>

</td>
</tr></table>
</form>
<?php
}
?>